package algotithm.interview.欧科云链.test3;

import java.io.*;

/**
 * @author zhouyanxiang
 * @Date 2021-04-2021/4/14-17:44
1219326320073159566072245112635269
1219326320073159566072245112635269
 */
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

        String s1 = reader.readLine();
        String s2 = reader.readLine();
        String multiply = multiply(s1, s2);
        writer.write(multiply + "\n");
        writer.flush();
        writer.close();
        reader.close();
    }

    public static  String multiply(String num1,String num2) {
        if ("0".equals(num1) || "0".equals(num2)) {
            return "0";
        }
        int m = num1.length();
        int n = num2.length();
        int[] ansArr = new int[m+n];
        for (int i = m - 1;i >= 0; i--) {
            int x = num1.charAt(i) - '0';
            for (int j = n - 1; j >= 0; j--) {
                int y = num2.charAt(j) - '0';
                ansArr[i + j + 1] += x * y;
            }
        }
        for (int i = m + n - 1; i > 0; i--) {
            ansArr[i - 1] += ansArr[i] / 10;
            ansArr[i] %= 10;
        }
        int idx = ansArr[0] == 0 ? 1 : 0;
        StringBuilder sb = new StringBuilder();
        while (idx < m + n) {
            sb.append(ansArr[idx]);
            idx++;
        }
        return sb.toString();
    }
}
